import { ApiProperty } from '@nestjs/swagger';
import { IsEmail, IsOptional, IsString, MinLength } from 'class-validator';

export class CreateUserDto {
  @ApiProperty({ description: '用户名，长度至少为 3 个字符' })
  @IsString()
  @MinLength(3)
  username: string;

  @ApiProperty({ description: '密码，长度至少为 6 个字符' })
  @IsString()
  @MinLength(6)
  password: string;

  @ApiProperty({ required: false, description: '用户邮箱，可选' })
  @IsOptional()
  @IsEmail()
  email?: string;
}